function foo(...args){
    console.log(arguments);
    console.log(args);
}

foo(1,2,3,4);